﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Draco.Algorithms;

namespace BusinessEntities
{
    public class MetroLink
    {
        public MetroNode From { get; }
        public MetroNode To { get; }
        public int LineID { get; }
        public int Distance { get; }

        public int Time { get; }

        public MetroLink(MetroNode from, MetroNode to,int lineId)
        {
            if (from == null) throw new ArgumentNullException("from");
            if (to == null) throw new ArgumentNullException("to");

            From = from;
            To = to;
            LineID = lineId;

            Distance = (int)D_Vector2D.Distance(from.X,from.Y,to.X,to.Y);
            Time = 3;  //假设一站行驶3分钟
        }

        public override string ToString()
        {
            return From.Name + "->" + To.Name;
        }
    }
}
